﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using MS.InformationManagement.Presenter.Support;
using System.Collections;
using MS.InformationManagement.Support;
using MS.InformationManagement.Support.Constants;
using MS.InformationManagement.Controls._CONTROLTEMPLATES.InformationManagerControls;

namespace MS.InformationManagement.WP.DocumentCenter.PrestamosDocumentales
{
    public partial class PrestamosDocumentalesUserControl : UserControl
    {
        public int CountSolicitudesEnviadas { get; set; }
        public int CountSolicitudesRecibidas { get; set; }
        public int CountPrestamos { get; set; }
        public int CountDevoluciones { get; set; }


        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            LoadControl();

            IdSolicitudesEnviadas.InnerText = "Solicitudes enviadas (" + CountSolicitudesEnviadas + ")";
            IdSolicitudesRecibidas.InnerText = "Solicitudes recibidas (" + CountSolicitudesRecibidas + ")";
            IdPrestamos.InnerText = "Prestamos (" + CountPrestamos + ")";
            IdDevoluciones.InnerText = "Devoluciones (" + CountDevoluciones + ")";
        }

        private void LoadControl()
        {
            CountSolicitudesEnviadas = SolicitudesPrestamoEnviadasID.listaSolicitud.Count;
            CountSolicitudesRecibidas = SolicitudesPrestamoRecibidasID.listaSolicitud.Count;
            CountPrestamos = PrestamosByUserID.listaSolicitud.Count;
            CountDevoluciones = PrestamosDevolucionesID.listaSolicitud.Count;
        }
    }
}
